using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
using Matrix.ServiceDiscovery.Entities;
using Matrix.ServiceDiscovery.Enums;

namespace Matrix.ServiceDiscovery.Repositories
{
    /// <summary>
    /// 服务信息仓储接口
    /// </summary>
    public interface IServiceInfoRepository : IRepository<ServiceInfo, Guid>
    {
        Task<ServiceInfo?> GetByNameAsync(string name, bool includeDetails = false, CancellationToken cancellationToken = default);

        Task<List<ServiceInfo>> GetListByNameAsync(string name, bool includeDetails = false, CancellationToken cancellationToken = default);

        Task<List<ServiceInfo>> GetListByTypeAsync(ServiceType serviceType, bool includeDetails = false, CancellationToken cancellationToken = default);

        Task<List<ServiceInfo>> GetListByStatusAsync(ServiceStatus status, bool includeDetails = false, CancellationToken cancellationToken = default);

        Task<bool> ExistsByNameAsync(string name, CancellationToken cancellationToken = default);

        Task<List<ServiceInfo>> GetRunningServicesAsync(bool includeDetails = false, CancellationToken cancellationToken = default);
    }
}